﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Restarty_SIPO3.Class
{
    class Posta
    {
        private string suma;

        public String IDPosty { get; set; }
        public int PocetKlientov { get; set; }
        public String Znamienko { get; set; }

        public String CelkovaSuma
        {
            get
            {
                return suma.Replace(",", ".");
            }
            set
            {
                suma = value;
            }
        }
        public ArrayList Rajony { get; set; }

        public Posta()
        {
            Rajony = new ArrayList();
        }

        internal string VytvorRetazec(Subor DataSubor,String MenoSuboru)
        {
            String tmpStr = null;
            foreach(Posta tmpPosta in DataSubor.PolePost)
            {
                tmpStr += "(''" + tmpPosta.IDPosty + "''," + tmpPosta.PocetKlientov + ",''" + tmpPosta.Znamienko + "''," + tmpPosta.CelkovaSuma + ",''" + MenoSuboru + "''),";
            }
            return tmpStr.Substring(0, tmpStr.Length - 1);
        }
    }
}
